CXX := g++
CXXFLAGS := -std=c++11 -Wall -O0 -I../../include
LDFLAGS := -pthread

# EchoServer依赖的公共源文件，包含NetWork.cc
ECHOSERVER_SRCS := \
    ../../source/Acceptor.cc \
    ../../source/Any.cc \
    ../../source/Buffer.cc \
    ../../source/Channel.cc \
    ../../source/Connection.cc \
    ../../source/EventLoop.cc \
    ../../source/LoopThread.cc \
    ../../source/LoopThreadPool.cc \
    ../../source/NetWork.cc \
    ../../source/Poller.cc \
    ../../source/Socket.cc \
    ../../source/TcpServer.cc \
    ../../source/TimerTask.cc \
    ../../source/TimerWheel.cc \
    echo.cc

all: server

server:
	$(CXX) $(CXXFLAGS) -o $@ EchoServer.cc $(ECHOSERVER_SRCS) $(LDFLAGS) -g

.PHONY: clean
clean:
	rm -f server
